public class 造房子 {

    public static void main(String[] args) {
        int N = 5;
        int M = 7;
        fun1(N,M);
    }
    public static void fun1(int n,int m){
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                System.out.print("+-");
            }
            System.out.println("+");
            for (int j = 0; j < m; j++) {
                System.out.print("|*");
            }
            System.out.println("|");
        }
        for (int j = 0; j < m; j++) {
            System.out.print("+-");
        }
        System.out.println("+");

    }
}
